import request from '@/utils/request'

/**
 *
 * @param ids {number[]} 歌曲id
 * @param level {string} 播放音质等级
 */
export const getSongUrl = (ids: number[], level: string = 'lossless') =>
  request<IGetSongUrlRes>(`/song/url/v1?id=${ids.join(',')}&level=${level}`)

// 喜欢与不喜欢该音乐
export const favoriteSong = (id: number, like: boolean) =>
  request(`/like?id=${id}&like=${like}&timestamp=${Date.now()}`)
// 获取喜欢的音乐列表
// uid: number = 1581112955
export const getLikelist = (uid: number = 32953014) =>
  request<{ code: number; ids: number[] }>(`/likelist?uid=${uid}&timestamp=${Date.now()}`)

// 获取歌曲歌词
/**
 *
 * @param id {number} 歌曲id
 */
export const getSongLyric = (id: number) => request<IGetSongLyricRes>(`/lyric/new?id=${id}`)
